import request from '@/utils/request'

//创建团队
export const createTeam = (data) => {
  return request({
    method: 'post',
    url: '/team/add',
    data
  })
}

// 获取团队列表
export const getTeamList = (params) => {
  return request({
    params,
    method: 'get',
    url: '/team/find'
  })
}

// 获取某个团队信息
export const getTeamInfo = (params) => {
  return request({
    params,
    method: 'get',
    url: '/team/user/find'
  })
}

// 编辑团队头像、名称等
export const editTeamInfo = (data) => {
  return request({
    method: 'post',
    url: '/team/modify',
    data
  })
}

// 邀请用户
export const inviteInfoTeam = (data) => {
  return request({
    method: 'post',
    url: '/team/user/add',
    data
  })
}

// 接受邀请
export const acceptInvite = (data) => {
  return request({
    method: 'post',
    url: '/team/user/modifyAccept',
    data
  })
}
// 移除邀请用户
export const removeInvite = (data) => {
  return request({
    method: 'post',
    url: '/team/user/remove',
    data
  })
}

// 编辑团队成员权限
export const editPer = (data) => {
  return request({
    method: 'post',
    url: '/team/user/modify',
    data
  })
}
// 编辑备注
export const editbz = (data) => {
  return request({
    method: 'post',
    url: '/team/user/modifyInfo',
    data
  })
}
// 退出团队
export const removeTeam = (data) => {
  return request({
    method: 'post',
    url: '/team/user/removeMe',
    data
  })
}

// 解散团队
export const removeAllTeam = (data) => {
  return request({
    method: 'post',
    url: '/team/removeAll',
    data
  })
}

// 解散团队条件判断
export const isRemoveTeam = (data) => {
  return request({
    method: 'post',
    url: '/team/isRemoveAll',
    data
  })
}

// 移交管理员
export const transferTeam = (data) => {
  return request({
    method: 'post',
    url: '/team/transferTeam',
    data
  })
}
